package com.pignest.hotel.beans;

import java.util.Date;

import com.pignest.hotel.annotation.Bean;
import com.pignest.hotel.beans.global.BaseBean;
import com.pignest.hotel.system.Hotel;


@Bean("账务")
public class TbAccounts extends BaseBean {
	private static final long serialVersionUID = -6196832182514346477L;
	
	public static final int STATE_NORMAL = 0;//正常账目
	
	public static final int STATE_DELETE = 1;//删除
	private Living living;
	/**金额*/
	private int price;
	/**类型，押金、续存款、物品消费、房间调整费等*/
	private String type;
	/**备注*/
	private String remark;
	/**操作时间*/
	private Date optime;
	/**状态：是否结账*/
	private String endstate;
	/**结账时间*/
	private Date endtime;
	/**数量*/
	private float counts;
	/**商品名称*/
	private String name;
	/**单价*/
	private int price2;
	/**结账ID（冗余tb_close_accounts）*/
	private String accountsId;
	/**默认0为正常账目*/
	private int state ;
	
	private String opUser;

	public TbAccounts(String id){
		this.id=id;
		this.state=STATE_NORMAL;
		this.optime=new Date();
		//this.opUser=Hotel.getCurrentUser().getName();
		
	}

	/**入账日期**/
	private String opdate;//用来自动处理当天房费格式必须为YYYY-MM-dd
	// Constructors

	public Living getLiving() {
		return living;
	}

	public void setLiving(Living living) {
		this.living = living;
	}

	/** default constructor */
	public TbAccounts() {
	}

	public int getPrice() {
		return this.price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getOptime() {
		return this.optime;
	}

	public void setOptime(Date optime) {
		this.optime = optime;
	}

	public String getEndstate() {
		return this.endstate;
	}

	public void setEndstate(String endstate) {
		this.endstate = endstate;
	}

	public Date getEndtime() {
		return this.endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	public float getCounts() {
		return this.counts;
	}

	public void setCounts(float counts) {
		this.counts = counts;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getPrice2() {
		return this.price2;
	}

	public void setPrice2(int price2) {
		this.price2 = price2;
	}

	public String getAccountsId() {
		return this.accountsId;
	}

	public void setAccountsId(String accountsId) {
		this.accountsId = accountsId;
	}
	public String getOpdate() {
		return opdate;
	}

	public void setOpdate(String opdate) {
		this.opdate = opdate;
	}
	
	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}
	


	public String getOpUser() {
		return opUser;
	}

	public void setOpUser(String opUser) {
		this.opUser = opUser;
	}

	public String getState2(){
		switch (state) {
		case 0:
			return "正常";
		case 1:
			return "已删除";

		default:
			break;
		}
		return "无效状态";
	}

	@Override
	public String toSimpleString() {
		return concat(living.getRoom().getName(), name, String.valueOf(price));
	}
}